package com.comtime.view;

import com.comtime.smartkilimanjaro.R;

import android.content.Context;
import android.graphics.drawable.ColorDrawable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup.LayoutParams;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.PopupWindow;

public class SendPingLunPopwindow extends PopupWindow {
	private View mMenuView;
	LinearLayout line_send;
	EditText edt_info;
	 
	public SendPingLunPopwindow(Context context,final OnClickListenterBack onClickListenterBack){
		
		super(context);
		LayoutInflater inflater = (LayoutInflater) context
				.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		mMenuView = inflater.inflate(R.layout.popwindow_sendpinglun,
				null);
		
		edt_info=(EditText) mMenuView.findViewById(R.id.edt_info);
		line_send=(LinearLayout) mMenuView.findViewById(R.id.line_send);
		
		line_send.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View arg0) {
				onClickListenterBack.onClick(edt_info.getText().toString());
				
			}
		});
		
		

		// ����SelectPicPopupWindow��View
		this.setContentView(mMenuView);
		// ����SelectPicPopupWindow��������Ŀ�
		this.setWidth(LayoutParams.MATCH_PARENT);
		// ����SelectPicPopupWindow��������ĸ�
		this.setHeight(LayoutParams.WRAP_CONTENT);
		// ����SelectPicPopupWindow��������ɵ��
		this.setFocusable(true);
		// ����SelectPicPopupWindow�������嶯��Ч��
		this.setAnimationStyle(R.style.AnimBottom);
		// ʵ��һ��ColorDrawable��ɫΪ͸��
		ColorDrawable dw = new ColorDrawable(0x00000000);
		// ����SelectPicPopupWindow��������ı���
		this.setBackgroundDrawable(dw);
	}
	
	public interface OnClickListenterBack{
		public void onClick(String str);
	}
}
